<?php use_helper('LetsManager'); ?>
<?php use_helper('Date'); ?>

<h2>Statistiques des adhérents</h2>
<?php if ($sf_user->hasFlash('notice')): ?>
<div class="flash_notice"><?php echo $sf_user->getFlash('notice') ?></div>
<?php endif ?>
<table class="datalist">
  <thead>
    <tr>
      <th width="30%">Adhérent</th>
      <th width="20%">Nombre d'échanges</th>
      <th width="30%">Date du dernier échange</th>
      <th width="20%">Solde du compte</th>
      
    </tr>
  </thead>
  <tbody>
  <?php foreach ($membersStats as $stats): ?>
    <tr>
      <td><?php echo link_to($stats->memberName,'@lets_user_show?id='.$stats->memberId,array('popup'=>true)) ?></td>
      <td><?php echo $stats->nbExchanges ?></td>

      <td><?php if($stats->dateLastExchange != null): ?> <?php echo format_date($stats->dateLastExchange) ?>
      <?php else: ?> Aucun échange <?php endif ?></td>
      <td><?php echo $stats->moneyAvailable .' '?></td>
    </tr>
    <?php endforeach ?>
  </tbody>
</table>
    <?php //include_partial('global/pager', array('pager' => $echangesPager, 'route' => '@lets_members_stats', 'params' => array())) ?>
